package vista

import code._
import org.uqbar.arena.widgets.Panel
import org.uqbar.arena.layout.VerticalLayout
import org.uqbar.arena.widgets.TextBox
import org.uqbar.arena.widgets.Button
import java.awt.Color
import org.uqbar.arena.Application
import org.uqbar.arena.windows.SimpleWindow
import org.uqbar.arena.windows.WindowOwner
import org.uqbar.arena.windows.Window
import org.uqbar.arena.widgets.tables.Table
import org.uqbar.commons.utils.Observable

class AgregarDisponibilidadWindow(owner: WindowOwner) extends SimpleWindow[Disponibilidad](owner, new Disponibilidad("Lunes",8,14)) {
  override def addActions(actionsPanel: Panel) = {
    // new Button(actionsPanel) 
    //.setCaption("")
    //.onClick(new MessageSend(this.getModelObject(), ""))
    
  }
  
  override def createFormPanel(mainPanel: Panel) {

    this.setTitle("Agregar Disponibilidad")

    mainPanel.setLayout(new VerticalLayout)

    new TextBox(mainPanel).bindValueToProperty("horaDeEntrada")
    
    new TextBox(mainPanel).bindValueToProperty("horaDeSalida")
    
    new TextBox(mainPanel).bindValueToProperty("dia")
  


    
    new Button(mainPanel)
	  .setCaption("Aceptar")
	  //.onClick(new MessageSend(this.getModelObject(), "cambiarNombre")) // aca tiene que hacer el binding a la ventana correspondiente
      .setBackground(Color.ORANGE)
     
    new Button(mainPanel)
	  .setCaption("Cancelar")
	  //.onClick(new MessageSend(this.getModelObject(), "cambiarNombre")) // aca tiene que hacer el binding a la ventana correspondiente

  }



}
 
 object RunWindows extends Application with App {
  def createMainWindow():Window[_] = new AgregarDisponibilidadWindow(this)
 
  start()
}
